import 'package:flutter/material.dart';
import 'package:home/mvp/view/group_page.dart';
import 'package:home/mvp/view/tree_list_page.dart';
import 'package:resource/generated/l10n.dart';

import 'drag_layout_page.dart';
import 'gv_list_page.dart';
import 'multi_select_page.dart';

class ChatPageBody {
  static final ChatPageBody _chatPageBody = ChatPageBody._internal();

  factory ChatPageBody() => _chatPageBody;

  ChatPageBody._internal();

  final PageController _pageController = PageController();

  PageController get pageController => _pageController;

  final List<Tab> myTabs = <Tab>[
    Tab(text: S.current.multi_select),
    Tab(text: S.current.group_list),
    Tab(text: S.current.tree_list),
    Tab(text: S.current.grid_layout),
    Tab(text: S.current.motion_layout),
  ];

  Widget createBody(BuildContext context) {
    return DefaultTabController(
      length: myTabs.length,
        child: Column(children: [
          TabBar(
            tabs: myTabs,
            labelColor: Colors.black,
            unselectedLabelColor: Colors.black54,
            labelStyle: const TextStyle(fontWeight: FontWeight.w600),
            indicatorColor: Colors.blue,
            indicatorWeight: 1,
            isScrollable: true,
          ),
          Expanded(
              flex: 1,
              child: TabBarView(children: <Widget>[
                const MultiSelectPage(),
                GroupPage(),
                const TreeListPage(),
                const GvListPage(),
                const DragLayoutPage()
              ]))
        ]));
  }
}
